package com.demo.study.behavior.d01_chainOfResponsibility.serverlet;

import com.demo.study.behavior.d01_chainOfResponsibility.serverlet.filter.NameFilter;
import com.demo.study.behavior.d01_chainOfResponsibility.serverlet.filter.PlaceFilter;
import com.demo.study.behavior.d01_chainOfResponsibility.serverlet.filter.SensitiveFilter;

/**
 * @author Baymax
 * @since 2021/1/17
 */
public class ServerLetMain {
    public static void main(String[] args) {
        Request request = new Request("Hello :) <name>, welcome to <place>, here is 996!", "张三", "中国");
        Response response = new Response("Hello :) <name>, welcome to <place>, here is 996!", "张三", "中国");

        FilterChain fc = new FilterChain();
        fc.add(new NameFilter()).add(new PlaceFilter()).add(new SensitiveFilter());
        fc.doFilter(request, response, fc);

        System.out.println(request.getMsg());
        System.out.println(response.getMsg());
    }
}
